﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
namespace XWG.JWBST.JWBSTSPConst
{
    public class ExMethodJWBST
    {
        public class Authority
        {
            /// <summary>
            ///  方法对照词典
            /// </summary>
            private static StringDictionary DictionaryMethod = new StringDictionary();
            private static Authority authority;
            public static Authority Instance()
            {
                if (authority == null)
                {
                    authority = new Authority();
                }
                return authority;
            }
            private Authority()
            {
                DictionaryMethod.Add("01", "AddRecord");//新建
                DictionaryMethod.Add("03", "EditRecord");//修改
                DictionaryMethod.Add("02", "DeleteRecord");//删除
                DictionaryMethod.Add("05", "GetModel");//获取实例信息
                DictionaryMethod.Add("04", "QueryRecord");//查询
                DictionaryMethod.Add("07", "QueryRecordByUser");//获取用户数据规则权限
                DictionaryMethod.Add("EditPassword", "EditPassword");//修改密码
                DictionaryMethod.Add("InitPassword", "InitPassword");//初始化密码
                DictionaryMethod.Add("SelectResID", "SelectResID");//获取资源信息
                DictionaryMethod.Add("Auth", "Auth");//授权
                DictionaryMethod.Add("UserResource", "UserResource");//授权

            }
            public string GetMethodName(string key)
            {
                string strTemp = string.Empty;

                strTemp = DictionaryMethod[key];

                if (strTemp == string.Empty || strTemp == null || strTemp.Trim().Length == 0)
                {
                    return key;
                }
                else
                {
                    return strTemp;
                }
            }
   
        }
    }
}
